<template>
    <div class="chart" id="twochart" style="width: 600px;height: 350px;margin: 50px auto;" ></div>
</template>

  
<script>
import * as echarts from "echarts";
export default {
  mounted() {
      // 获取容器元素
      const chartContainer = document.getElementById("twochart");
      // 初始化 ECharts 实例
      const myChart = echarts.init(chartContainer);
       // 设置图表的配置项和数据
      const option = {
       
            tooltip: {},
            legend: {
                data:['人流量数据']

            },
            xAxis: {
                type: 'category',
                data: ["一月","二月","三月","四月","五月"]
            },
            yAxis: {
                type:'value'
            },
            series: [{
                name: '人流量数据',
                type: 'line',
                data: [150, 489, 324, 288, 135,],
                // data: [1245, 7824, 1248, 2575, 3424]
            }]
      
};
// 将配置项应用到图表实例上
myChart.setOption(option);
},
  };

</script>
  
<style lang='less'>

</style>
